]> dgit.raspbian.org Git - gnome-shell.git/commit
mobile-providers: new country-specific type to gather providers
authorAleksander Morgado <aleksander@lanedo.com>
Thu, 1 Nov 2012 16:52:09 +0000 (17:52 +0100)
committerAleksander Morgado <aleksander@lanedo.com>
Mon, 5 Nov 2012 21:20:08 +0000 (22:20 +0100)
commit70736be4eb5d9de0cee52aa47bb68ea6a7d8d518
treed7c468d090f723f4a7cbf2f382d72696365019ae
parent1c3e7330f368e1574d71df6b137677a295eb740d
mobile-providers: new country-specific type to gather providers

shell_mobile_providers_parse() was returning the country information split
into a hash table with providers and a hash table with country names. This
patch merges both outputs into a single per-country object, so the parse()
method now returns a GHashTable with the following element-type:
   (element-type utf8 ShellCountryMobileProvider>)
This also avoids more complex setups like returning lists inside of hash tables,
which was actually breaking either g-i or gtk-doc.

shell_mobile_providers_parse() was also modified to allow inputting the paths
of the country codes and provider list files to use. If paths are not given, the
default ones will be used. This helps us to provide test files during unit
tests.

Both the findProviderForMCCMNC() and findProviderForSid() methods are exported
out of the GSM and CDMA specific classes, and new unit tests for them are
implemented. Tests can be run manually with:
    $> ./tests/run-test.sh tests/unit/mobileProviders.js

https://bugzilla.gnome.org/show_bug.cgi?id=687356.
js/misc/modemManager.js
src/shell-mobile-providers.c
src/shell-mobile-providers.h
tests/Makefile.am
tests/testcommon/iso3166-test.tab [new file with mode: 0644]
tests/testcommon/serviceproviders-test.xml [new file with mode: 0644]
tests/unit/mobileProviders.js [new file with mode: 0644]